﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;
using Microsoft.SharePoint.Utilities;
using Microsoft.SharePoint;

namespace BDF.TagCloud.Utilities
{
    [AttributeUsage(AttributeTargets.All)]
    public class LocalizedCategoryAttribute: CategoryAttribute
    {
        private String categoryValue;

        public LocalizedCategoryAttribute() : this("Default") { }

        public LocalizedCategoryAttribute(String s) { categoryValue = s; }

        protected override string GetLocalizedString(string value)
        {
            return SPUtility.GetLocalizedString("$Resources:" + categoryValue, "TagCloudFeature", SPContext.Current.Web.Language); 
        }
    }
}
